package com.infnoon.ojback.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.infnoon.ojback.model.dto.contest.ContestDoRequest;
import com.infnoon.ojback.model.dto.contest.ContestQueryRequest;
import com.infnoon.ojback.model.dto.contest.ContestRegisterRequest;
import com.infnoon.ojback.model.entity.Contest;
import com.infnoon.ojback.model.entity.User;
import com.infnoon.ojback.model.vo.ContestVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author 31124
* @description 针对表【contest(比赛)】的数据库操作Service
* @createDate 2025-01-06 20:23:46
*/
public interface ContestService extends IService<Contest> {
    /**
     * 校验
     *
     * @param contest
     */
    void validContest(Contest contest);

    /**
     * 获取查询条件
     *
     * @param contestQueryRequest
     * @return
     */
    QueryWrapper<Contest> getContestQueryWrapper(ContestQueryRequest contestQueryRequest);

    /**
     * 获取比赛封装
     *
     * @param contest
     * @param request
     * @return
     */
    ContestVO getContestVO(Contest contest, HttpServletRequest request);

    /**
     * 分页获取题目封装
     *
     * @param contestPage
     * @param request
     * @return
     */
    Page<ContestVO> getContestVOPage(Page<Contest> contestPage, HttpServletRequest request);

    /**
     * 注册比赛
     *
     * @param contestRegisterRequest
     * @param loginUser
     */
    void doContestRegister(ContestRegisterRequest contestRegisterRequest, User loginUser);

    /**
     * 进入比赛
     *
     * @param contestDoRequest
     * @param loginUser
     */
    void doContest(ContestDoRequest contestDoRequest, User loginUser);
}
